from typing import Union

my_list: list[Union[int, str]] = [1, 2, 'zgq']


def f(arg: Union[int, str]) -> Union[int, str]:
    pass


r = f(1)
